package ru.rchervot.sanasar.client.rpc;

import ru.rchervot.sanasar.client.model.ItemObject;
import ru.rchervot.sanasar.client.model.SearchResultsItem;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("rpc")
public interface RPCService extends RemoteService {
//	<T extends Response> T execute(Action action) throws Exception;
	
	<T extends GetPageResponse<SearchResultsItem>> T 
	execute(GetPage action) throws Exception;
	
	<T extends GetItemResponse<ItemObject>> T
	execute(GetItem action) throws Exception;
	
	<T extends GetQueryResponse> T 
	execute(GetQuery action) throws Exception;
	
	<T extends SaveQueryResponse> T
	execute(SaveQuery action) throws Exception;
}
